/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.storage.entity;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;

import javax.validation.constraints.NotNull;

/**
 * 轮播图Entity
 */
@Table(name="biz_banner", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="sort", attrName="sort", label="顺序"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="type", attrName="type", label="类型【栏目/活动】"),
		@Column(name="activity_id", attrName="activityId", label="活动id"),
		@Column(name="route_id", attrName="routeId", label="栏目Id"),
		@Column(name="create_by", attrName="createBy", label="创建者", isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false)
	}, orderBy="a.update_date DESC"
)
public class Banner extends DataEntity<Banner> {

	private static final long serialVersionUID = 1L;
	private Integer sort;		// 顺序
	private String thumbnail;    //缩略图
	private String type;		// 类型【栏目/活动】
	private String activityId;		// 活动id
	private String routeId;		// 栏目Id

	private Activity activity;//活动
	private Route route;//栏目

	public Banner() {
		this(null);
	}

	public Banner(String id){
		super(id);
	}

	@NotNull(message="顺序不能为空")
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getActivityId() {
		return activityId;
	}

	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	public String getRouteId() {
		return routeId;
	}

	public void setRouteId(String routeId) {
		this.routeId = routeId;
	}

	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	public Route getRoute() {
		return route;
	}

	public void setRoute(Route route) {
		this.route = route;
	}
}